<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

    <head>
        <meta charset="utf-8">
            <title>淘天机站群系统管理后台</title>
            <!-- include header_meta -->
            <style type="text/css">
            #poplayer {
                position: fixed;
                _position: absolute;
                top: 15%;
                left: 50%;
                width: 450px;
                margin-left: -225px;
                min-height: 350px;
                z-index: 8888;
                display: none;
                background-color: #FFF;
                padding: 10px;
            }
            #covered {
                position: fixed;
                _position: absolute;
                z-index: 888;
                top: 0px;
                left: 0px;
                width: 100%;
                height: 100%;
                background-color: Black;
                opacity: 0.3;
                display: none;
            }

        </style>
    </head>

    <body>
        <div id="covered"></div>
        <div id="poplayer">
            <div>
                <h1 onclick="hideCon()">上传须知</h1></div>
            <div style="padding: 8px;border:dashed 1px #ccc; margin: 5px 0;">
                <p>上传文件必须是txt文件</p>
                <p>词库用英文逗号“,”隔开</p>
                <p style="color:red;">正在上传中,请不要刷新页面，请耐心等待，上传成功页面会自动刷新</p>
            </div>
            <div class="control-group" style="padding: 10px 0;">
                作用范围：
                <!-- if $currentYuming -->
                当前站点【
                <font color="red">{$currentYuming['name']}</font>】
                <!-- else -->
                所有站点【
                <font color="red">
                    <—要添加到指定站点，请先选择站点</font>】
                <!-- /if -->
            </div>
            <div id="uploader" class="wu-example">
                <!--用来存放文件信息-->
                <div id="file_upload">上传文件</div>
                </div>
            </div>
            <div id="msg"></div>
        <!-- include header -->
        <div class="cp-wrap {if $jnarrow}jnarrow{/if}">
            <div class="crumb"></div>
            <div class="cp-table-top cl">
                <div class="fl" style="margin-right:10px;display: inline-block;">
                    <a href="?m=seo&a=words_add&yuming_id={$currentYumingId}" class="btn">单个添加</a>
                </div>
                <div class="fl" style="margin-right:10px;display: inline-block;">
                    <a href="javascript:void(0);" class="btn" onclick="showCon()">批量上传</a>
                </div>
                <div class="fl" style="margin-right:10px;display: inline-block;">
                     <a class="btn" href="?m=seo&a=words_drop&yuming_id={$currentYumingId}" onclick="return confirm('确定要清空当前表数据？')">清空当前表数据</a>
                </div>
                <div class="fr">
				<form method="get">
					<input type="hidden" name="m" value="seo">
					<input type="hidden" name="a" value="words">
					<input name="stitle" value="{$stitle}" type="text" placeholder="请输入您要搜索的标题">
					<input type="submit" value="搜索" class="btn" />
				</form>
			</div>
            </div>
            <div class="cp-table">
                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tbody>
                        <tr>
                            <th width="35" align="left"></th>
                            <th align="left">关键词
                            </th>
                            <th width="100" align="center">操作</th>
                        </tr>
                        <!-- foreach $list -->
                        <tr>
                            <td align="left"></td>
                            <td align="left"> {$title}</td>
                            <td align="center">
                                <a href="?m=seo&a=words_del&id={$id}&yuming_id={$currentYumingId}" onclick="return confirm('确定删除？')">删除</a>
                            </td>
                        </tr>
                        <!-- /foreach -->
                    </tbody>
                </table>
               
            </div>
            <!-- if empty($list) -->
            <div class="noresult">暂时没有可显示数据</div>
            <!-- /if -->
            <div class="cp-pages">
                {$page}
            </div>
        </div>
        <!-- include footer -->
        <script>
            $(function () {
                var uploader = WebUploader.create({
                    auto: true,
                    swf: '__APPROOT__/js/webuploader.swf',
                    server: '?m=seo&a=words_upload&ssid={$_COOKIE[ssid]}&yuming_id={$currentYumingId}',
                    pick: '#file_upload',
                    accept: {
                        title: 'intoTypes',
                        extensions: 'txt',
                        mimeTypes: 'text/plain,application/plain'
                    }
                });
                uploader.on('uploadSuccess', function(file, res) {
                    if(res.status==1) {
                        cpAlert('上传成功，共：'+res.result.count+'条数据，即将开始处理...',2);
                        window.location.href="?m=seo&a=words_doing&yuming_id={$currentYumingId}";
                    }
                });
                
                
//                $('#file_upload').uploadify({
//                    'swf': '/static/uploadify/uploadify.swf',
//                    'uploader': '?m=seo&a=words_upload&ssid={$_COOKIE[ssid]}&yuming_id={$currentYumingId}',
//                    'buttonText': '开始上传关键词库',
//                    'onUploadSuccess': function (file, data, response) {
//                        $("#file_upload").val(data);
//                        setTimeout(function () {
//                            window.location.href = window.location.href;
//                        }, 1250)
//                    },
//                });
            });
        </script>
        
        <script type="text/javascript">
            function showCon() {
                $("#covered").show();
                $("#poplayer").show();
            }

            function hideCon() {
                $("#covered").hide();
                $("#poplayer").hide();
            }
            $(function () {
                $("#covered").click(function () {
                    $("#covered").hide();
                    $("#poplayer").hide();
                });
            })
            
        </script>
    </body>

</html>
